import React from "react";
import { DeleteFilled } from "@ant-design/icons";
import { useHistory } from "react-router-dom";
import style from "./index.module.less";
import "./index.less";
interface IProps {
  title: string;
  id: string;
  date: string;
  image: string;
  type: string;
}
const ProjectItem = (props: IProps) => {
  const { title, date, id, type } = props;
  const history = useHistory();
  const deleteProject = async () => {
   console.log(props.id);
  };
 
  return (
    <div
      className={style.projectItemContainer}
      onClick={() => history.push(`/diagram/${type}/${id}`)}
    >
      <div>{title}</div>
      <div>{date}</div>
      <DeleteFilled onClick={deleteProject} />
    </div>
  );
};
export default ProjectItem;